package com.kevin.learn.pool;

import com.google.common.collect.Lists;

import java.util.ArrayList;
import java.util.List;

public class TestPool {

    public static void main(String[] args) {
//        ScheduledExecutorService pool = Executors.newScheduledThreadPool(5);
//
//        pool.schedule(() -> System.out.println("当前线程:"+Thread.currentThread().getName()+"我被执行了，当前时间" + new Date()), 1, TimeUnit.SECONDS);
//
//        for (int i = 0; i < 10; i++) {
//            pool.schedule(() -> System.out.println("当前线程:"+Thread.currentThread().getName()+"我被执行了，当前时间" + new Date()), i, TimeUnit.SECONDS); 
//        }
//        pool.shutdown();


        List<Integer> count = new ArrayList<>();
        for (int i = 0; i < 100; i++) {
            count.add(i);
        }

        System.out.println(count);
        List<List<Integer>> partition = Lists.partition(count, 30);
        System.out.println(partition);
    }
}
